import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/selectModule'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/selectModule',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/selectModule.vue'),
                    meta: { title: '选择模块' }
                },
                {
                    path: '/monitor',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/monitor.vue'),
                    meta: { title: '矿机监控' }
                },
                {
                    path:'/detail',
                    component:() => import (/* webpackChunkName: "dashboard" */  '../components/page/detail.vue'),
                    meta:{ title:'矿机监控详情' }
                },
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/repair',
                    component: () => import(/* webpackChunkName: "repair" */ '../components/page/Repair.vue'),
                    meta: { title: '维修界面' }
                },
                {
                    path: '/history',
                    component: () => import(/* webpackChunkName: "repair" */ '../components/page/History.vue'),
                    meta: { title: '历史记录' }
                },
                {
                    path: '/guidance',
                    component: () => import(/* webpackChunkName: "repair" */ '../components/page/GuidancePage.vue'),
                    meta: { title: '维修指引' }
                },
                {
                    path: '/repairHistory',
                    component: () => import(/* webpackChunkName: "repair" */ '../components/page/RepairHistory.vue'),
                    meta: { title: '维修历史记录' }
                },
                {
                    path: '/icon',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Icon.vue'),
                    meta: { title: '自定义图标' }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                },
                {
                    path: '/serviceError',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/ServiceError.vue'),
                    meta: { title: '连接服务器失败' }
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
